import request from '@/utils/request'

export function getZwmpUsage(module) {
  const condition = {}
  condition['module'] = module

  return request({
    url: 'rtc/zwmpUsage',
    method: 'post',
    data: condition
  })
}

export function getZwmpPort(module) {
  const condition = {}
  condition['module'] = module

  return request({
    url: 'rtc/zwmpPort',
    method: 'post',
    data: condition
  })
}

export function getZwmpChans(module, room) {
  const condition = {}

  if (module) {
    condition['module'] = module
  }
  if (room) {
    condition['room'] = room
  }

  return request({
    url: 'rtc/zwmpChans',
    method: 'post',
    data: condition
  })
}

export function getZwmpChanDetail(module, conf, call, chan, type) {
  const condition = {}
  condition['module'] = module
  condition['confid'] = conf
  condition['callid'] = call
  condition['chanid'] = chan
  condition['type'] = type

  return request({
    url: 'rtc/zwmpChanDetail',
    method: 'post',
    data: condition
  })
}

